using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FiltronASP.Modules.Abstracts;
using FiltronASP.Models.DAO.Interfaces;
using System.Web.UI.WebControls;
using FiltronASP.Models;
using FiltronASP.Helpers.CatalogueMenu;
using FiltronASP.Helpers.Translations;

namespace FiltronASP.Modules
{
    public class sizesCarsSearchModuleFiltron : AbstractModule
    {
        private Page currentPage;

        /// <summary>
        /// Klasa odpowiedzialna za generowanie contentu przez modul.
        /// </summary>
        /// <param name="page">biezaca strona</param>
        /// <returns>content</returns>
        public override string GenerateContent(FiltronASP.Models.Page page)
        {
            this.currentPage = page;
            int pageId = page.page_id;
            int languageId = Convert.ToInt32(page.language_id);
            return this.generateBottomMenu(languageId, pageId) + this.generateInnerContent(languageId);
        }

        private string generateBottomMenu(int languageId, int pageId)
        {
            string htmlToReturn = "";
            //htmlToReturn += "<div id=\"bottomMenu\">";
            //htmlToReturn += "   <div class=\"selectMarketMenu selectMarketMenuSizes\">";
            //htmlToReturn += "       <span class=\"changeMarketInfo\">" + translationHelper.getTranslation("_currentMarketInfoFiltron", languageId) + "</span>";
            //htmlToReturn += "       <a href=\"change-market,129.html\" class=\"changeMarketButton\">" + translationHelper.getTranslation("_changeMarket", languageId) + "</a>";
            //htmlToReturn += "   </div>";
            //htmlToReturn += "   <ul class=\"selectCarTypeMenu\">";

            //htmlToReturn += CatalogueMenuHelper.generateMenuFiltron(languageId, pageId);

            //htmlToReturn += "   </ul>"; //</selectCarTypeMenu>
            htmlToReturn += "<div class=\"col-xs-12\" style=\"margin-bottom: 40px; \">";
            htmlToReturn += "<div id=\"selectCarTypeMenuUnder\"> ";
            htmlToReturn += "<div class=\"col-md-10 col-sm-12 col-xs-12\">";
            htmlToReturn += "<div class=\"col-xs-12 no-padding mar-b-20\">";
            htmlToReturn += "<div class=\"selectCarTypeMenuUnderSingle col-md-5 col-sm-6 col-xs-12\" >";
            htmlToReturn += "<label for=\"\" class=\"col-md-4 col-sm-6 col-xs-12\">" + translationHelper.getTranslation("_catType", languageId) + "</label>";
            htmlToReturn += "<select  class=\"col-md-8 col-sm-6 col-xs-12\" onchange=\"doTypeDropDownWork(this, '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "')\" id=\"styleDropDown\" name=\"brand\" >";
            htmlToReturn += "<option value=\"-1\" selected=\"selected\">" + translationHelper.getTranslation("_selectType", languageId) + "</option>";
            htmlToReturn += "<option value=\"air\">" + translationHelper.getTranslation("_airFilter", languageId) + "</option>";
            htmlToReturn += "<option value=\"oil\">" + translationHelper.getTranslation("_oilFilter", languageId) + "</option>";
            htmlToReturn += "<option value=\"fuel\">" + translationHelper.getTranslation("_fuelFilter", languageId) + "</option>";
            htmlToReturn += "<option value=\"cabin\">" + translationHelper.getTranslation("_cabinFilter", languageId) + "</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"selectCarTypeMenuUnderSingle col-md-5 col-sm-6 col-xs-12\" >";
            htmlToReturn += "<label for=\"\" class=\"col-md-4 col-sm-6 col-xs-12\">" + translationHelper.getTranslation("_catShape", languageId) + "</label>";
            htmlToReturn += "<select class=\"col-md-8 col-sm-6 col-xs-12\" onchange=\"recognizeDimensions(this, '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "')\" name=\"brand\" id=\"typeDropDown\">";
            htmlToReturn += "<option value=\"\" selected=\"selected\">" + translationHelper.getTranslation("_selectSizeShape", languageId) + "</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsInputs\">";
            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim1\" style=\"display: block;\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">A</label>";
            htmlToReturn += "<input type=\"text\"  name=\"name\" id=\"dimAtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimAselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim2\">";
            htmlToReturn += "<div class=\"dimensionsSingle1  col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">B</label>";
            htmlToReturn += "<input type=\"text\" name=\"name\" id=\"dimBtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimBselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "		<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim3\">";
            htmlToReturn += "		<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "	<label for=\"\">C</label>";
            htmlToReturn += "		<input type=\"text\"  name=\"name\" id=\"dimCtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimCselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim4\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">D</label>";
            htmlToReturn += "<input type=\"text\"  name=\"name\" id=\"dimDtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimDselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim5\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">E</label>";
            htmlToReturn += "<input type=\"text\"  name=\"name\" id=\"dimEtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimEselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim6\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">F</label>";
            htmlToReturn += "<input type=\"text\"  id=\"dimFtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimFselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim7\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">G</label>";
            htmlToReturn += "<input type=\"text\"  id=\"dimGtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimGselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div class=\"dimSingleContainer col-lg-4 col-md-6 col-sm-6 col-xs-12\" id=\"dim8\">";
            htmlToReturn += "<div class=\"dimensionsSingle1 col-xs-8 no-padding\">";
            htmlToReturn += "<label for=\"\">H</label>";
            htmlToReturn += "<input type=\"text\"  name=\"name\" id=\"dimHtext\">";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class=\"dimensionsSingleSelect col-xs-4 no-padding\" >";
            htmlToReturn += "<label for=\"\">±</label>";
            htmlToReturn += "<select id=\"dimHselect\" name=\"brand\" >";
            htmlToReturn += "<option value=\"5\" selected=\"selected\">5</option>";
            htmlToReturn += "<option value=\"10\">10</option>";
            htmlToReturn += "<option value=\"20\">20</option>";
            htmlToReturn += "</select>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += " <div class=\"col-xs-12 mar-top-20\">";
            htmlToReturn += "<div class=\"col-xs-12 dimen-search\" style=\"display:none;\" id=\"searchButtonSizes\" >"/*onclick=\"doSizeWork('" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "', 0,20)\" />" */ +
               Helpers.Translations.translationHelper.getTranslation("_search", (int)this.currentPage.language_id) + "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += " <div class=\"col-md-2 col-sm-12 col-xs-12\">";
            htmlToReturn += "<div class=\"sizesSamplePhoto\"></div>";
            htmlToReturn += "</div>";
            htmlToReturn += "<div style=\"clear:both\"></div>";
            htmlToReturn += "</div>"; //
            htmlToReturn += "</div>"; //</selectCarTypeMenuUnder>
            htmlToReturn += "</div>"; //
            return htmlToReturn;
        }

        private string generateInnerContent(int languageId)
        {
            string htmlToReturn = "";
            htmlToReturn += " <div id=\"contentHolderInner\">";
            htmlToReturn += " <div id=\"ajaxStatementInfo\">" + translationHelper.getTranslation("_ajaxSizesInfo", languageId) + "</div>";
            htmlToReturn += this.generateEnginePart();
            htmlToReturn += "</div> <!-- #contentHolderInner -->"; // #contentHolderInner
            return htmlToReturn;
        }

        private string generateEnginePart()
        {
            string htmlToReturn = "";
            htmlToReturn += "<div class=\"col-lg-4 col-md-6 col-sm-6 col-xs-12 no-padding filters-resp-padding \" style=\"color: white\" id=\"searchLeftSide\"></div>";
            htmlToReturn += "<div id='filterDetailsLoader' style='text-align: center; display: none;' class='col-xs-6'><img style='margin: 0 auto;' alt='loading' src='/Content/img/ajax-loader.gif' class='img-responsive'></div>";
            htmlToReturn += "<div class=\"col-lg-8 col-md-6 col-sm-6 col-xs-12 results-ajax filters-resp-padding sizesRightSide searchRightSide\" id='filterDetails'>";
            /*htmlToReturn += "   <div class=\"searchRightSideTop\"></div>";
            htmlToReturn += "   <div id=\"searchRightSideBottom\"></div>";*/
            htmlToReturn += " <div class=\"col-xs-12\" id='filterDetailsLoader'>";
            htmlToReturn += " <img class=\"img-responsive\"  src=\"" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "\" alt=\"loading\" style=\"  margin: 0 auto; margin-top: 12px; display: none;\">";
            htmlToReturn += " </div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div> <!-- #contentHolderInner -->"; // #contentHolderInner
            
            return htmlToReturn;
           
        }



    }
}
